package com.gohead.server.crawel.data;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.config.AbstractMongoClientConfiguration;
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;

@Configuration
@EnableMongoRepositories
@ConditionalOnProperty(name = "gohead.data.store.type",havingValue = "mongo")
public class CraweMongolRepository  extends AbstractMongoClientConfiguration {

    @Value("${gohead.data.store.database:gohead}")
    private String database;
    @Override
    protected String getDatabaseName() {
        return database;
    }
}
